<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html:xhtml />
<script type="text/javascript">
    function hideExcel(){
        $("#geneSnpExcel").toggle();
    }

    function fileTip(){
        $("#fileTip").dialog({
            autoOpen:true
        })
    }

    function textTip(){
        $("#textTip").dialog({
            autoOpen:true
        })
    }

    function useText(){
        $("#useText").show();
        $("#useFile").hide();
    }

    function useFile(){
        $("#useFile").show();
        $("#useText").hide();
    }

    function featureTip(){
        $("#featureTip").dialog({
            autoOpen:true
        })
    }
</script>
<div id="geneSnp" class="content input">
    <h2><html:link style="float:left;" href="#" styleClass="ui-icon help ui-icon-info" onclick="featureTip()"></html:link>Gene to Kegg Pathway</h2>
    <html:errors property="geneSnp" />
    <html:errors property="geneList" />
    <html:form action="genePathway" enctype="multipart/form-data">
        <dl>
            <dt>How would you like to input genes?</dt>
            <dd>
                <html:radio property="useTextarea" value="text" onclick="useText()">Text</html:radio>
                <html:radio property="useTextarea" value="file" onclick="useFile()">File Upload</html:radio>
            </dd>
        </dl>
        <logic:equal property="useTextarea" name="geneSnpForm" value="file">
            <div id="useFile" style="display:block">
            </logic:equal>
            <logic:notEqual property="useTextarea" name="geneSnpForm" value="file">
                <div id="useFile" style="display:none">
                </logic:notEqual>
                <dl>
                    <dt>Upload Gene List:<html:link href="#" styleId="generalHelpButton" styleClass="ui-icon help ui-icon-info" onclick="fileTip()"></html:link></dt>
                    <dd class="ddpositionFix"><html:file property="file"/></dd>
                </dl>
            </div>

            <logic:equal property="useTextarea" name="geneSnpForm" value="text">
                <div id="useText" style="display:block">
                </logic:equal>
                <logic:notEqual property="useTextarea" name="geneSnpForm" value="text">
                    <div id="useText" style="display:none">
                    </logic:notEqual>
                    <dl>
                        <dt>Enter Gene List:<html:link href="#" styleClass="ui-icon help ui-icon-info" onclick="textTip()"></html:link></dt>
                        <dd class="ddpositionFix"><html:textarea property="textInput"></html:textarea></dd>
                    </dl>
                </div>
                <dl>
                    <dt>Skip results page and export data?</dt>
                    <dd><html:checkbox property="excel" onclick="hideExcel()"/> (Recommended for large datasets)</dd>
                </dl>
                <logic:equal name="geneSnpForm" property="excel" value="true">
                    <div id="geneSnpExcel" style=" display: block">
                    </logic:equal>
                    <logic:notEqual name="geneSnpForm" property="excel" value="true">
                        <div id="geneSnpExcel" style=" display: none">
                        </logic:notEqual>
                        <dl>
                            <dt>Filename:</dt>
                            <dd><html:text property="filename"/></dd>
                            <dt>Delimiter:</dt>
                            <dd><html:select property="dlimiter">
                                    <html:option value="tab">Tab Delimited</html:option>
                                    <html:option value="csv">Comma Separated</html:option>
                                </html:select>
                            </dd>
                        </dl>
                    </div>

                    <html:submit value="Next" property="submitType" styleClass="button" />
                </html:form>
            </div>
            <div id="featureTip" style="display:none">
                This feature takes a list of genes and returns all the pathways that the specified genes are in. The results are displayed on an interactive table with sorting, paging, and filtering capabilities. Note that this feature takes the same gene list as the one used by "Gene to SNP"
            </div>
            <div id="fileTip" style="display:none">
                The file should be formatted as such: <br/>
                First Column: NCBI Gene ID<br/>
                Second Column: Gene Name<br/>
                <br/>
                Accepts CSV, XLS, and Tab-delimited TXT files.
            </div>

            <div id="textTip" style="display:none">
                Text input should be formatted like:<br/>
                "Gene_ID" "Gene Name"<br/>
                <br/>
                For example: <br/>
                1 A1BG <br/>
            </div>